package com.zmn.plat.common.constant;

/**
 * 类描述：redis key 常量
 *
 * @author xujie
 * @since 2021/04/08 11:02
 */
public class RedisKeyConstant {

    /**
     * 冒号分隔符 (:)
     */
    private static final String COLON = ":";

    public static final String NO_DATA = "NO DATA";

    /**
     * 根据渠道ID获取渠道信息 key
     */
    private static final String CHANNEL_DRO = "plat:channelDRO:";

    /**
     * 根据渠道ID获取渠道信息 key 请求锁
     */
    private static final String LOCK_CHANNEL_DRO = "plat:lock:channelDRO:";

    /**
     * 根据渠道ID查询渠道订单配置 key
     */
    private static final String CHANNEL_ORDER_CONFIG_DRO = "plat:channel:orderConfigDRONew:";

    /**
     * 根据渠道ID查询渠道订单配置 key 请求锁
     */
    private static final String LOCK_CHANNEL_ORDER_CONFIG_DRO = "plat:lock:channel:orderConfigDRONew:";

    /**
     * 根据渠道ID获取结算信息 key
     */
    private static final String CHANNEL_SETTLE_DRO = "plat:channelSettleDRO:";

    /**
     * 根据渠道ID获取结算信息 key 请求锁
     */
    private static final String LOCK_CHANNEL_SETTLE_DRO = "plat:lock:channelSettleDRO:";

    /**
     * 根据父ID查询渠道 key
     */
    private static final String PARENT_CHANNEL_DRO = "plat:parentChannelDRO:";

    /**
     * 根据父ID查询渠道 key 请求锁
     */
    private static final String LOCK_PARENT_CHANNEL_DRO = "plat:lock:parentChannelDRO:";

    /**
     * 根据渠道id查询开通了分类的渠道id，如果当前渠道是二级渠道有数据，返回当前渠道id；没有数据，根据父级渠道查询分类是否开通，如果开通返回父渠道id； key
     */
    private static final String CHANNEL_AVAILABLE_CATEGORY = "plat:channel:availableCategory:";

    /**
     * 根据渠道id查询开通了分类的渠道id，如果当前渠道是二级渠道有数据，返回当前渠道id；没有数据，根据父级渠道查询分类是否开通，如果开通返回父渠道id； key 请求锁
     */
    private static final String LOCK_CHANNEL_AVAILABLE_CATEGORY = "plat:lock:channel:availableCategory:";

    /**
     * 根据渠道ID、产品分类 查询服务分类 key
     */
    private static final String CHANNEL_SERVER_CATEGORY = "plat:channel:serverCategory:";

    /**
     * 根据渠道ID、产品分类 查询服务分类 key 请求锁
     */
    private static final String LOCK_CHANNEL_SERVER_CATEGORY = "plat:lock:channel:serverCategory:";

    /**
     * 获取渠道押金 key
     */
    private static final String CHANNEL_DEPOSIT = "plat:channel:deposit:";

    /**
     * 获取渠道押金 key 请求锁
     */
    private static final String LOCK_CHANNEL_DEPOSIT = "plat:lock:channel:deposit:";

    /**
     * 菜单 key
     */
    public static final String MENU = "plat:menu:";

    /**
     * 获取渠道保证金 key
     */
    private static final String CHANNEL_BAIL = "plat:channel:bail:";

    /**
     * 获取渠道保证金 key 请求锁
     */
    private static final String LOCK_CHANNEL_BAIL = "plat:lock:channel:bail:";

    /**
     *  根据渠道ID获取渠道信息key
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getKeyChannelDro(Integer channelId) {

        return CHANNEL_DRO + channelId;
    }

    /**
     *  根据渠道ID获取渠道信息key 请求锁
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getLockKeyChannelDro(Integer channelId) {

        return LOCK_CHANNEL_DRO + channelId;
    }

    /**
     *  根据渠道ID查询渠道订单配置key
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getKeyChannelOrderConfigDro(Integer channelId) {

        return CHANNEL_ORDER_CONFIG_DRO + channelId;
    }

    /**
     *  根据渠道ID查询渠道订单配置 请求锁
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getLockKeyChannelOrderConfigDro(Integer channelId) {

        return LOCK_CHANNEL_ORDER_CONFIG_DRO + channelId;
    }

    /**
     *  根据渠道ID获取结算信息 key
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getKeyChannelSettleDro(Integer channelId) {

        return CHANNEL_SETTLE_DRO + channelId;
    }

    /**
     *  根据渠道ID获取结算信息 请求锁
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getLockKeyChannelSettleDro(Integer channelId) {

        return LOCK_CHANNEL_SETTLE_DRO + channelId;
    }

    /**
     *  根据父ID查询渠道 key
     *
     * @param parentChannelId 渠道上级id
     * @return key
     * @author xujie
     * @since 2021/04/09
     */
    public static String getKeyParentChannelDro(Integer parentChannelId) {

        return PARENT_CHANNEL_DRO + parentChannelId;
    }

    /**
     *  根据父ID查询渠道 请求锁
     *
     * @param parentChannelId 渠道上级id
     * @return key
     * @author xujie
     * @since 2021/04/09
     */
    public static String getLockKeyParentChannelDro(Integer parentChannelId) {

        return LOCK_PARENT_CHANNEL_DRO + parentChannelId;
    }

    /**
     *  根据渠道id查询开通了分类的渠道id，如果当前渠道是二级渠道有数据，返回当前渠道id；没有数据，根据父级渠道查询分类是否开通，如果开通返回父渠道id key
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getKeyAvailableCategoryByChannelId(Integer channelId) {

        return CHANNEL_AVAILABLE_CATEGORY + channelId;
    }

    /**
     *  根据渠道id查询开通了分类的渠道id，如果当前渠道是二级渠道有数据，返回当前渠道id；没有数据，根据父级渠道查询分类是否开通，如果开通返回父渠道id  请求锁
     *
     * @param channelId 渠道id
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getLockKeyAvailableCategoryByChannelId(Integer channelId) {

        return LOCK_CHANNEL_AVAILABLE_CATEGORY + channelId;
    }

    /**
     *  根据渠道ID、产品分类查询服务分类key
     *
     * @param channelId 渠道id
     * @param showType 产品分类 1后台 2前台
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getKeyServerCategoryByChannelIdAndShowType(Integer channelId, Integer showType) {

        return CHANNEL_SERVER_CATEGORY + channelId + COLON + showType;
    }

    /**
     *  根据渠道ID、产品分类查询服务分类key 请求锁
     *
     * @param channelId 渠道id
     * @param showType 产品分类 1后台 2前台
     * @return key
     * @author xujie
     * @since 2021/04/08
     */
    public static String getLockKeyServerCategoryByChannelIdAndShowType(Integer channelId, Integer showType) {

        return LOCK_CHANNEL_SERVER_CATEGORY + channelId + COLON + showType;
    }

    /**
     *  获取渠道押金 key
     *
     * @param channelId 渠道上级id
     * @return key
     * @author xujie
     * @since 2021/04/09
     */
    public static String getKeyChannelDeposit(Integer channelId) {

        return CHANNEL_DEPOSIT + channelId;
    }

    /**
     *  获取渠道押金 请求锁
     *
     * @param channelId 渠道上级id
     * @return key
     * @author xujie
     * @since 2021/04/09
     */
    public static String getLockKeyChannelDeposit(Integer channelId) {

        return LOCK_CHANNEL_DEPOSIT + channelId;
    }

    /**
     *  获取渠道押金 key
     *
     * @param channelId 渠道上级id
     * @return key
     * @author jiafei
     * @since 2021/06/16
     */
    public static String getKeyChannelBail(Integer channelId) {

        return CHANNEL_BAIL + channelId;
    }

    /**
     *  获取渠道押金 请求锁
     *
     * @param channelId 渠道上级id
     * @return key
     * @author jiafei
     * @since 2021/06/16
     */
    public static String getLockKeyChannelBail(Integer channelId) {

        return LOCK_CHANNEL_BAIL + channelId;
    }

}
